package com.zhongyu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongyu.mapper.ShenHemAPPER;
import com.zhongyu.pojo.Order;
import com.zhongyu.service.ShenHemAPPERService;
import com.zhongyu.vo.PageResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

@Service("shenHemAPPERService")
public class ShenHemAPPERAerviceImpl extends ServiceImpl<ShenHemAPPER, Order> implements ShenHemAPPERService {

    @Resource
    private ShenHemAPPER shenHemAPPER;
    @Override
    public PageResult searchAll(Integer pageNo, Integer pageSize) {
        LambdaQueryWrapper<Order> wrapper= Wrappers.<Order>lambdaQuery();
        Page page=new Page(pageNo,pageSize);
        List<Order> list=shenHemAPPER.findAll(page,wrapper);
        return new PageResult(list,page.getTotal());
    }

    @Override
    public void update(String state, LocalDateTime checkTime, Integer id,Integer shenhe) {
        shenHemAPPER.update(state,checkTime,id,shenhe);
    }
}
